<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type ="text/javascript">
		/*	//1、1-100之间所有数的和
			var sum = 0;
			for(var i = 1;i <= 100;i++){
				sum += i;
			}
			console.log(sum);
			//2、1-100之间既是3的倍数，也是5的倍数
			for (var j = 1; j <= 100;j++) {
				if ( j % 3 == 0 && j % 5 == 0) {
					console.log(j);
				}
			} */
			//3、求 0+5 1+4 2+3 3+2 4+1 5+0 的和
			var m = 0,n = 5;
			var	sum;
			for (var i = 0; i <= 5; i++) {
				sum = m + n;
				m++;
				n--;
				console.log(sum);
			}
			//4、求2，-4，6，-8，10，-12，.......,第n个值
			var num = 2;
			if (num % 2 == 0 ) {
				console.log("第n个数的值：",2*num);
			} else{
				console.log("第n个数的值：",-2*num);
			}
			
		</script>
	</body>
</html>
